package com.suoluo.zenadmin.vo.account;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class AccountVO {
	/**
	 * 用户编号
	 */
	private int accountId;
	/**
	 * 用户名称
	 */
	private String accountName;
	/**
	 * 用户头像
	 */
	private String accountHead;
	/**
	 * 1:男，2：女，0：未知
	 */
	private int accountGender;
	/**
	 * 用户创建时间
	 */
	private Date accountCreateTime;
//	/**
//	 * 用户第三方平台信息
//	 */
//	private TbOpenAccount openAccount;
	
	private Map<Integer,OpenAccountVO> openAccountMap;
	
	public int getAccountId() {
		return accountId;
	}
	public void setAccountId(int accountId) {
		this.accountId = accountId;
	}
	public String getAccountName() {
		return accountName;
	}
	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}
	public String getAccountHead() {
		return accountHead;
	}
	public void setAccountHead(String accountHead) {
		this.accountHead = accountHead;
	}
	
	public int getAccountGender() {
		return accountGender;
	}
	public void setAccountGender(int accountGender) {
		this.accountGender = accountGender;
	}
	public Date getAccountCreateTime() {
		return accountCreateTime;
	}
	public void setAccountCreateTime(Date accountCreateTime) {
		this.accountCreateTime = accountCreateTime;
	}
	
	public void addOpenAccount(OpenAccountVO openAccount){
		if (openAccountMap == null){
			openAccountMap = new HashMap<Integer, OpenAccountVO>();
		}
		if (openAccount != null){
			openAccountMap.put(Integer.valueOf(openAccount.getOpenType()),openAccount);
		}
	}
	
	public void removeOpenAccount(OpenAccountVO openAccount){
		if (openAccountMap != null){
			openAccountMap.remove(openAccount.getOpenType());
		}
	}
	
	public OpenAccountVO getOpenAccount(int openType){
		if (openAccountMap != null){
			return openAccountMap.get(Integer.valueOf(openType));
		}
		return null;
	}
}
